
pkgname=btrfs-progs
pkgver=4.17
pkgrel=1
pkgdesc="Btrfs filesystem utilities."
arch=('x86_64')
url="https://btrfs.wiki.kernel.org/"
license=('GPL2')
depends=('glibc' 'e2fsprogs' 'lzo2' 'asciidoc' 'python3')
makedepends=('git' 'xmlto' 'python3-setuptools')
options=('!staticlibs')
source=("https://www.kernel.org/pub/linux/kernel/people/kdave/btrfs-progs/${pkgname}-v${pkgver}.tar.xz"
        'initcpio-install-btrfs'
        'initcpio-hook-btrfs')
sha256sums=('82ca0ecf76350a1e3c6543fe220c0910e240511e663d51fc79c32bd0052c117c'
            '34e1472c028875bb8cc7d06fa18aad9c1c90e3719de416733e9baac82a12cd94'
            '116a8fac508a3872b77f249e71d9de4f9b61cd20edfde01c99a5deba143769df')

build() {
   cd ${pkgname}-v${pkgver}
   
   ./configure --prefix=/usr \
      --disable-zstd
   make  
}

package() {
   cd ${pkgname}-v${pkgver}
   make prefix=${pkgdir}/usr udevdir=${pkgdir}/usr/lib/udev install

   mkdir -p ${pkgdir}/sbin
   ln -sf /usr/bin/btrfs ${pkgdir}/sbin/btrfs

   install -Dm644 ${srcdir}/initcpio-install-btrfs ${pkgdir}/usr/lib/initcpio/install/btrfs
   install -Dm644 ${srcdir}/initcpio-hook-btrfs ${pkgdir}/usr/lib/initcpio/hooks/btrfs
}
